package day05;

import java.util.Scanner;

public class MainTest003 {
    public static void main(String[] args) {
        int[] num=new int[5];
        int max=0;
        int min=0;
        int sum=0;
        double pingjun = 0;

        Scanner input = new Scanner(System.in);
        System.out.println("请输入每位学生的成绩：");
        for (int i= 0;i< num.length;i++){
            num[i]= input.nextInt();
        }
        max = num[0];
        min = num[0];
        for (int i=0;i<num.length;i++){
            sum=sum+num[i];
            if (num[i]>max){
                max= num[i];
            }
            if (num[i]<min){
                min=num[i];
            }
        }
        pingjun=sum/ num.length;
        System.out.println("总成绩："+sum);
        System.out.println("最高分："+max);
        System.out.println("最低分："+min);
        System.out.println("平均分："+pingjun);

    }
}
